function new_number = better_number_rec(number,result)
temp1 = number(result(:,3)==-1,:);
temp2 = zeros(sum(result(:,3)==-1),10);
for i = 1:size(temp1,1) 
    if temp1(i,1)==-1
        continue;
    end
    for j = 1:size(temp1,1)
        index = mod(temp1(i,1)+i-j,10);index(index==0)=10;
        temp2(j,index) = temp2(j,index)+temp1(i,2);
    end
end
for i = 1:size(temp1,1)
    [temp,index]=max(temp2(i,:));
    temp1(i,1) = index;
    temp1(i,2) = temp;
    if index==10
        temp1(1:i-1,1) = temp1(1:i-1,1) + 10;
    end
end
new_number = number;
new_number(result(:,3)==-1,:) = temp1(:,:);
for i = 1:size(new_number,1)
    if result(i,3) == -1
        continue;
    elseif i<size(new_number,1)
        new_number(i,1) = new_number(i+1,1)+0.5;
    else
        new_number(i,1) = new_number(i-1,1)-0.5;
    end
end